#!/bin/bash
#

useradd joker

/usr/bin/expect << eof
set timeout 10
spawn passwd joker
expect "New password:"
send "123456\n"
expect "Retype new password:"
send "123456\n"
expect eof
eof
